import excel "U:\u5390570\Hitler Youth Project\Main Data Analysis\Dienstgrad.xlsx", sheet("Dienstgrad") firstrow
save "U:\u5390570\Hitler Youth Project\Main Data Analysis\Ranks.dta"
keep PersID Dienstgrad Status_von
rename Dienstgrad rank
save "U:\u5390570\Hitler Youth Project\Main Data Analysis\Ranks.dta", replace
do "U:\u5390570\Hitler Youth Project\Main Data Analysis\Ranks do File.do"
gen timing=date(Status_von,"DMY")
tostring(Status_von), replace
gen timing=date(Status_von,"DMY")
list timing in 1/10
replace timing=Status_von
destring Status_von, replace
sort PersID
by PersID: egen min_date=min(Status_von)
keep if Status_von=min_date
keep if Status_von==min_date
duplicates report PersID
duplicates list PersID
list if duplicated(PersID)
duplicates report PersID
duplicates drop PersID, force
keep PersID grade
sum grade
save "U:\u5390570\Hitler Youth Project\Main Data Analysis\First Rank.dta"
clear
